package com.joysuch.wwyt.bp.controller;

import com.joysuch.wwyt.bp.bean.BpEnterpriseCertBean;
import com.joysuch.wwyt.bp.service.BpEnterpriseCertService;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;

/**
 * @Author ZhangDong
 * @Date 2021/1/14 9:30
 */
@RestController
@RequestMapping("/bp/enterprise/cert")
@Api(tags = "企业信息-企业证书")
public class BpEnterpriseCertController {

    @Autowired
    private BpEnterpriseCertService service;

    @PostMapping("save")
    @ApiOperation("新增/修改")
    public ResultBean save(@RequestBody BpEnterpriseCertBean bean) {
        return service.save(bean);
    }

    @GetMapping("delete")
    @ApiOperation("删除")
    public ResultBean delete(Long id) {
        return service.delete(id);
    }

    @GetMapping("get")
    @ApiOperation(value = "单体查询", response = BpEnterpriseCertBean.class)
    public ResultBean get(Long id) {
        return service.get(id);
    }

    @GetMapping("page")
    @ApiOperation(value = "分页查询", response = BpEnterpriseCertBean.class)
    public ResultBean page(Pageable pageable) {
        return service.page(pageable);
    }

}
